package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PointsAcquisitionRuleMapper;
import com.ruoyi.system.domain.PointsAcquisitionRule;
import com.ruoyi.system.service.IPointsAcquisitionRuleService;

/**
 * 积分获取规则（存储消费金额与积分获取比例的规则）Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-15
 */
@Service
public class PointsAcquisitionRuleServiceImpl implements IPointsAcquisitionRuleService
{
    @Autowired
    private PointsAcquisitionRuleMapper pointsAcquisitionRuleMapper;

    /**
     * 通过id查询积分获取规则
     *
     * @param id 积分获取规则（存储消费金额与积分获取比例的规则）主键
     * @return 积分获取规则（存储消费金额与积分获取比例的规则）
     */
    @Override
    public PointsAcquisitionRule selectPointsAcquisitionRuleById(Long id)
    {
        return pointsAcquisitionRuleMapper.selectPointsAcquisitionRuleById(id);
    }

    /**
     * 查询积分获取规则列表
     *
     * @param pointsAcquisitionRule 积分获取规则（存储消费金额与积分获取比例的规则）
     * @return 积分获取规则（存储消费金额与积分获取比例的规则）
     */
    @Override
    public List<PointsAcquisitionRule> selectPointsAcquisitionRuleList(PointsAcquisitionRule pointsAcquisitionRule)
    {
        return pointsAcquisitionRuleMapper.selectPointsAcquisitionRuleList(pointsAcquisitionRule);
    }

    /**
     * 新增积分获取规则列表
     *
     * @param pointsAcquisitionRule 积分获取规则（存储消费金额与积分获取比例的规则）
     * @return 结果
     */
    @Override
    public int insertPointsAcquisitionRule(PointsAcquisitionRule pointsAcquisitionRule)
    {
        return pointsAcquisitionRuleMapper.insertPointsAcquisitionRule(pointsAcquisitionRule);
    }

    /**
     * 修改积分获取规则列表
     *
     * @param pointsAcquisitionRule 积分获取规则（存储消费金额与积分获取比例的规则）
     * @return 结果
     */
    @Override
    public int updatePointsAcquisitionRule(PointsAcquisitionRule pointsAcquisitionRule)
    {
        return pointsAcquisitionRuleMapper.updatePointsAcquisitionRule(pointsAcquisitionRule);
    }

    /**
     * 批量删除积分获取规则列表
     *
     * @param ids 需要删除的积分获取规则（存储消费金额与积分获取比例的规则）主键
     * @return 结果
     */
    @Override
    public int deletePointsAcquisitionRuleByIds(Long[] ids)
    {
        return pointsAcquisitionRuleMapper.deletePointsAcquisitionRuleByIds(ids);
    }

    /**
     * 删除积分获取规则信息列表
     *
     * @param id 积分获取规则（存储消费金额与积分获取比例的规则）主键
     * @return 结果
     */
    @Override
    public int deletePointsAcquisitionRuleById(Long id)
    {
        return pointsAcquisitionRuleMapper.deletePointsAcquisitionRuleById(id);
    }
}
